package com.javafactroy.kunlong.domain.generalquery.valueobj;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum EnumQueryOprtType {
    //》 《　》＝《＝

    BT(">", "大于"),
    LT("<", "小于"),
    BE(">=", "大于等于"),
    LE("<=", "小于等于"),
    EQ("=", "等于"),
    NOTEQ("!=", "不等于"),
    IN("in", "在...范围内"),
    NOTIN("not in", "不在...范围内"),
    LIKE("like", "相似于"),
    NOTLIKE("not like", "不相似"),
    BETWEEN("between", "在...之间"),
    NOTBETWEEN("not between", "不在...之间");

    //操作符
    String oprtSign;
    //操作符名称
    String oprtName;

    EnumQueryOprtType(String oprtSign, String oprtName) {
        this.oprtSign = oprtSign;
        this.oprtName = oprtName;
    }
    /**
     * 转为数据
     * @return 枚举对象数组
     */
    public static List<Map<String, String>> toList() {
        List<Map<String, String>> list = new ArrayList<>();
        for (EnumQueryOprtType item : values()) {
            Map<String, String> map = new HashMap<>();
            map.put("oprtSign", item.oprtSign);
            map.put("oprtName", item.oprtName);
            list.add(map);
        }
        return list;
    }
    public String toString() {
        return oprtName + ":" + oprtSign;
    }
}
